home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / Amiga_Mail_Vol2 / Archives / Plain / nd91.lha / SWCompat / SWCompat.txt < prev   
Encoding:
Text File  |  1991-11-18  |  34.4 KB  |  750 lines

  1. (c)  Copyright 1991 Commodore-Amiga, Inc.   All rights reserved.
  2. The information contained herein is subject to change without notice,
  3. and is provided "as is" without warranty of any kind, either expressed
  4. or implied.  The entire risk as to the use of this information is
  5. assumed by the user.
  6.  
  7.  
  8. 2.0 Compatibility Problem Areas
  9.  
  10.  
  11. by Carolyn Scheppner, Bryce Nesbitt, Peter Cherna, and Darren Greenwald
  12.  
  13. Release 2.04 is finished and soon will be available in Enhancer Packs.  If
  14. your products are not yet compatible, your time is up.  If you are developing
  15. new software, you need to avoid the compatibility traps.  This comprehensive
  16. list of 2.0 compatibility problem areas can help you avoid compatibility
  17. problems.  Note that this document is not identical to the one published in
  18. the 1991 DevCon notes.  There are several extra problems covered here that
  19. weren't mentioned in the 1991 DevCon notes.
  20.  
  21.  
  22. General Compatibility Problem Areas
  23.  
  24. One sure fire way to write incompatible software is to fail to follow the
  25. Amiga programming guidelines listed in the beginning of your Amiga ROM Kernel
  26. and Amiga Hardware manuals.  Please read the guidelines and follow them!
  27.  
  28. The following improper Amiga programming practices are likely to fail on new
  29. ROMs or hardware:
  30.  
  31. o Calling ROM code directly.
  32.  
  33. o Directly or indirectly reading or writing random memory addresses or low
  34. memory (especially location zero) due to improperly initialized pointers or
  35. structures.  Use Mungwall and Enforcer when writing and testing your code!
  36.  
  37. o Assuming addresses/location/amounts of RAM or system structures.
  38.  
  39. o Requiring all free RAM.
  40.  
  41. o Mishandling 32-bit addresses.  For example, using signed math or signed
  42. comparisons on addresses, or doing a BOOL or WORD test to determine if a
  43. pointer is non-zero.
  44.  
  45. o Overwriting memory allocations.  With 32-bit addresses, a 1-byte overwrite
  46. of a string array can wipe out the high byte of a pointer or stack return
  47. address.  This bug could go unnoticed on a 24-bit address machine (eg.
  48. A500,A2500, etc) but crash the system or cause other problems on an A3000.
  49.  
  50. o Shaving stack size too close.  System function stack usage changes with
  51. each OS release. o Improper flags or garbage in system structures.  A bit
  52. that means nothing under one OS may drastically change the behavior of a
  53. function in a newer version of the OS.  Clear structures before using, and
  54. use correct flags.
  55.  
  56. o Passing garbage in previously unused upper bytes of function arguments (for
  57. example - the upper word of the ULONG AvailFonts() Flags parameter).
  58.  
  59. o Improper register or condition code handling.  Do not assume registers
  60. D0-D1/A0-A1 are preserved after system calls!  Some function calls happen to
  61. preserve some registers.  This can change in any revisions of the OS.  In
  62. some cases we have modifed the values returned in registers to keep certain
  63. applications from failing under 2.0.  We do not guarantee those modifications
  64. will remain in place.  Condition codes are also in an undefined state on the
  65. return from a system call.  Assembler code must test (TST,MOVE,CMP,etc.) D0
  66. results before branching on condition codes.  Use Scratch by Bill Hawes (via
  67. the scratchall script) to catch scratch register misuse in assembler code.
  68.  
  69. o Misuse of function return values.  Use function prototypes and read the
  70. Autodocs for the functions you are using.  Some system functions return just
  71. success or failure, or nothing at all (void).  In such cases, the value which
  72. the function happens to return must not be used except as it is documented.
  73.  
  74. o Calling system library functions from assembler without placing the library
  75. base pointer in A6.  All system functions may assume that their library's
  76. base pointer is in A6.  A function's need to reference its library base can
  77. change in different OS revisions.
  78.  
  79. o Depending on unsupported side effects or undocumented behavior.  Be sure to
  80. read the RKM chapters, Autodocs, and include file comments.
  81.  
  82. o Poking/peeking system private structures.  Do not poke or peek any system
  83. structure unless told to do so in official Commodore documentation.
  84.  
  85. o Assuming current choices, configurations or initial values.  If the current
  86. possibilities are A, B, or C, do not assume C if it isn't A or B.  Check
  87. specifically for the choices currently implemented, and provide default
  88. behavior for unexpected values.
  89.  
  90. o Failure to properly allocate resources before using them.
  91.  
  92. o Failure to properly close/deallocate resources.
  93.  
  94. o Improper reading/writing of hardware registers.  You must mask out bits you
  95. are not interested in on reads, and write undefined bits as zero.
  96.  
  97. o Assuming initial values of hardware registers.  If you are going direct to
  98. the hardware, do not depend on the initial values of any hardware registers.
  99. The settings may not be the same on different versions of the OS or from boot
  100. to boot.  Always set up all of the hardware registers that affect your code.
  101. o Processor speed dependencies such as software delay loops.
  102.  
  103. o Processor instruction dependencies.  Do not use instructions which are
  104. privileged on any Motorola 68xxx family processor.  Do not use CLR on a
  105. hardware register which is triggered by any access (use MOVE #0 instead).
  106. The 68000 CLR instruction performs two accesses (Read, then Write).  The
  107. 68020 and higher CLR instruction performs just one access.
  108.  
  109. o Depending on or failing to account for cache or prefetch effects.
  110. Self-modifying or trackdisk-loaded code requires cache flushes ( see the
  111. exec.library/CacheClearU() function ).
  112.  
  113. Amiga debugging tools such as Enforcer, Mungwall, and Scratch can find many program bugs that may affect compatibility.  A program that is Enforcer/Mungwall/Scratch clean stands a much better chance of working well under current and future versions of the OS.  These tools are on the Denver/Milano DevCon disks.  Enforcer and Mungwall are also on the kickfile disks.
  114.  
  115.  
  116. 2.0 Changes That Can Affect Compatibility
  117.  
  118. There are several 2.0-specific areas where OS changes and enhancements can
  119. cause compatibility problems for some software.
  120.  
  121. Exec
  122.  
  123. o Do not jump to location $FC0002 as part of performing a system RESET.  Many
  124. RESET functions jumped to what was the start of the ROM under 1.3.  The 2.0
  125. ROM is twice the size.  We've added a temporary compatibility hack called
  126. ``Kickety-Split'' to the 2.04 Kickstart ROM.  The ROM is split into two
  127. halves with a redirecting jump at $FC0002.  This hack does not appear on the
  128. A3000 and due to space considerations will not appear on future machines.
  129.  
  130. o Everything has moved.
  131.  
  132. o The Supervisor stack is not in the same place as it was under 1.3.  This
  133. has caused problems for some games that completely take over the Amiga.  If
  134. your program goes into Supervisor mode, you must either respect allocated
  135. memory or provide your own Supervisor stack when taking over the machine.
  136.  
  137. o ExecBase is moved to expansion memory if possible.  Previously, ExecBase
  138. would only end up in one of two fixed locations.  As a result, ColdCapture
  139. may be called after expansion memory has been configured.  Great pains were
  140. taken to make this compatible.
  141.  
  142. o Exception/Interrupt vectors may move.  This means the 68010 and above
  143. Vector Base Register (VBR) may contain a non-zero value.  Poking assumed low
  144. memory vector addresses may have no effect.  You must read the VBR on 68010
  145. and above to find the base.
  146.  
  147. o No longer tolerant of wild Forbid() counts.  Under 1.3, sometimes this bug
  148. could go unnoticed.  Make sure that all Forbid's are matched with one and
  149. only one Permit (and vice versa).
  150.  
  151. o When an Exec device gets an IORequest, it must validate io_Command.  If the
  152. io_Command is 0 or out of range, the device must return IOERR_NOCMD and take
  153. no other action.  The filesystem now sends new commands and expects older
  154. devices to properly ignore them.
  155.  
  156. o A 2.0 fix to task-switching allows a busy task to properly regain the
  157. processor after an interrupt until either its quantum (4 vertical blanks) is
  158. up or a higher priority task preempts it.  This can dramatically change the
  159. behavior of multitask programs where one task busyloops while another
  160. same-priority task Wait()s.  See Task Switching in the Additional Information
  161. section at the end of this document.
  162.  
  163.  
  164. Expansion
  165.  
  166. o ExpansionBase is private - use FindConfigDev().
  167.  
  168. o Memory from contiguous cards of the same memory type is automatically
  169. merged into one memory pool.
  170.  
  171.  
  172. Strap
  173.  
  174. o romboot.library is gone.
  175.  
  176. o audio.device cannot be OpenDevice()ed by a boot block program because it is
  177. not yet InitResident()ed.  If OpenDevice() of audio.device fails during
  178. strap, you must FindResident()/InitResident() audio.device, and then try
  179. OpenDevice() again.
  180.  
  181. o Boot from other floppies (+5,-10,-20,-30) is possible.
  182.  
  183. o Undocumented system stack and register usage at Diag and Boot time have
  184. changed.
  185.  
  186.  
  187. DOS
  188.  
  189. o DOS is now written in C and assembler, not BCPL.  The BCPL compiler
  190. artifact which caused D0 function results to also be in D1 is gone.  2.0
  191. compatibility patches which return some DOS function results in both D0 and
  192. D1 are not guaranteed to remain in the next release.  Fix your programs! Use
  193. Scratch to find these problems in your code.
  194.  
  195. o DOS now has a real library base with normal LVO vectors.
  196.  
  197. o Stack usage has all changed (variables, direction).
  198.  
  199. o New packet and lock types.  Make sure you are not passing stack garbage for
  200. the second argument to Lock().
  201.  
  202. o Process structure is bigger.  ``Rolling your own'' Process structure from a
  203. Task fails.
  204.  
  205. o Unless documented otherwise, you must be a process to call DOS functions.
  206. DOS function dependence on special process structures can change with OS
  207. revisions.
  208.  
  209.  
  210. Audio.device
  211.  
  212. o Now not initialized until used.  This means low memory open failure is
  213. possible.  Check your return values from OpenDevice().  This also means
  214. audio.device cannot be opened during 2.0 Strap unless InitResident()ed first.
  215. If OpenDevice() of audio.device fails during strap, you must
  216. FindResident()/InitResident() audio.device, and then try OpenDevice() again.
  217. There will be a small memory loss (until reboot) generated by the first
  218. opener of audio.device or narrator.device (memory used in building of
  219. audio.device's base).
  220.  
  221.  
  222. Gameport.device
  223.  
  224. o Initial state of hardware lines may differ.
  225.  
  226.  
  227. Serial.device
  228.  
  229. o Clears io_Device on CloseDevice() (since 1.3.2)
  230.  
  231.  
  232. Timer.device
  233.  
  234. o The most common mistake programmers make with timer.device is to send off a
  235. particular timerequest before the previous use of that timerequest has
  236. completed.  Use IO_Torture to catch this problem.
  237.  
  238. o IO_QUICK requests may be deferred and be replied as documented.
  239.  
  240. o VBLANK timer requests, as documented, now wait at least as long as the full
  241. number of VBlanks you asked for.  Previously, a partial vertical blank could
  242. count towards your requested number.  The new behavior is more correct and
  243. matches the docs, but it can cause VBlank requests to now take up to 1 VBlank
  244. longer under 2.0 as compared to 1.3.  For example, a 1/10 second request, may
  245. take 6-7 Vblanks instead of 5-6 VBlanks, or about 15% longer.
  246.  
  247.  
  248. Trackdisk
  249.  
  250. o Private trackdisk structures have changed.  See trackdisk.doc for a
  251. compatible REMCHANGEINT.
  252.  
  253. o Buffer is freeable, so low memory open failure is possible.
  254.  
  255. o Do not disable interrupts (any of them) then expect trackdisk to function
  256. while they are disabled.
  257.  
  258.  
  259. CIA Timers
  260.  
  261. o System use of CIA timers has changed.  Don't peek timers you think the
  262. system is using in a particular manner.
  263.  
  264. o Don't depend on initial values of CIA registers.
  265.  
  266. o Don't mess with CIABase.  Use cia.resource.
  267.  
  268. o If your code requires hardware level CIA timers, allocate the timers using
  269. cia.resource AddICRVector()! Very important!  Operating system usage of the
  270. CIA timers has changed.  The new 2.0 timer.device (``Jumpy the Magic Timer
  271. Device'') will try to jump to different CIA's so programs that properly
  272. allocate timers will have a better chance of getting what they want.  If
  273. possible, be flexible and design your code to work with whatever timer you
  274. can successfully allocate.
  275.  
  276. o OS usage of INT6 is increasing.  Do not totally take over INT6, and do not
  277. terminate the server chain if an interrupt is not for you.
  278.  
  279.  
  280. Other Hardware Issues
  281.  
  282. o Battery-backed clock is different on A3000.  Use battclock.resource to
  283. access the real-time clock if battclock.resource can be opened.
  284.  
  285. o A 68030 hardware characteristic causes longword-aligned longword writes to
  286. allocate a valid entry in the data cache,  even if the hardware area
  287. shouldn't be cached.  This can cause problems for IO registers and shared
  288. memory devices.  To solve this: 1) Don't do that 2) Flush the cache or 3) Use
  289. Enforcer Quiet.  See the Motorola 68030 manual under the description of the
  290. Write Allocate bit (which must be set for the Amiga to run with the Data
  291. Cache).
  292.  
  293.  
  294. Intuition
  295.  
  296. o Private IBase variables have moved/changed.  Reading them is illegal.
  297. Writing them is both illegal and dangerous.
  298.  
  299. o Poking IBase MaxMouse variables is now a no-op, but please stop poking when
  300. Intuition version is >35.
  301.  
  302. o If you are opening on the Workbench screen, be prepared to handle larger
  303. screens, new modes, new fonts, and overscan.  Also see Font compatibility
  304. information. o Screen TopEdge and LeftEdge may be negative.
  305.  
  306. o LeftAmiga-Select is used for dragging large screens.  Do not use
  307. LeftAmiga-key combinations for application command keys.  The LeftAmiga key
  308. is reserved for system use.
  309.  
  310. o For compatibility reasons, GetScreenData() lies if the Workbench screen is
  311. a mode only available after release 1.3.  It will try to return the most
  312. sensible mode that old OpenScreen() can open.  This was necessary to keep
  313. applications that cloned the Workbench screen from having problems.  To
  314. properly handle new modes, see LockPubScreen() and GetVPModeID(), and the
  315. SA_DisplayID tag for OpenScreenTags().
  316.  
  317. o Using combined RAWKEY and VANILLAKEY now gives VANILLAKEY messages for
  318. regular keys, and RAWKEY messages for special keys (fkeys, help, etc.)
  319.  
  320. o Moving a SIMPLE_REFRESH window does not necessarily cause a REFRESHWINDOW
  321. event because layers now preserves all the bits it can.
  322.  
  323. o Sizing a SIMPLE_REFRESH window will not clear it.
  324.  
  325. o MENUVERIFY/REQVERIFY/SIZEVERIFY can time out if you take too long to
  326. ReplyMsg().
  327.  
  328. o Menu-key equivalents are ignored while string gadgets are active.
  329.  
  330. o You can't type control characters into string gadgets by default.  Use
  331. CTRL-Amiga-char to type them in or use IControl Prefs to change the default
  332. behavior.
  333.  
  334. o Width and Height parameters of AutoRequest are ignored.
  335.  
  336. o New default colors, new gadget images.
  337.  
  338. o JAM1 rendering/text in border may be invisible gadgets over default colors.
  339.  
  340. o The cursor for string gadgets can no longer reside outside the cleared
  341. container area.  If your gadget is (for example) 32 pixels wide, with
  342. MaxChars of 4, then all 32 pixels will be cleared, instead of just 24, as was
  343. true in 1.3.
  344.  
  345. o Applications and requesters that fail to specify desired fonts will get
  346. user 2.0 Font Pref fonts that may be much larger or proportional in some
  347. cases.  Screen and window titlebars (and their gadgets) will be taller when
  348. accomodating a larger font.  Applications which open on the Workbench screen
  349. must adapt to variable size titlebars.  Any application which accepts system
  350. defaults for its screen, window, menu, Text or IntuiText fonts must adapt to
  351. different fonts and titlebar sizes.  String gadgets whose height is too small
  352. for a font will revert to a smaller ROM font.  There are now 2 different
  353. user-specifiable default system fonts which affect different Intuition
  354. features.  This can lead to mismatches in mixed gadgets and text.  For more
  355. information on where various system fonts come from and how they can be
  356. controlled, see Intuition Fonts in the Additional Information section at the
  357. end of this document.
  358.  
  359. o Don't modify gadgets directly without first removing them from the gadget
  360. list, unless you are using a system function designed for that purpose, such
  361. as NewModifyProp() or SetGadgetAttrs().
  362.  
  363. o Don't rely on NewModifyProp() to fully refresh your prop gadget after
  364. you've changed values in the structure.  NewModifyProp() will only correctly
  365. refresh changes which were passed to it as parameters.  Use
  366. Remove/Add/RefreshGList() for other kinds of changes.
  367.  
  368. o Custom screens must be of type CUSTOMSCREEN or PUBLICSCREEN.  Other types
  369. are illegal.  One application opens their screen with NewScreen.Type = 0
  370. (instead of CUSTOMSCREEN, 0x0F).  Then, when they open their windows, they
  371. specify NewWindow.Type of 0 and NewWindow.Screen of NULL, instead of
  372. Type=CUSTOMSCREEN and Screen=(their screen).  That happened to work before,
  373. but they are now broken.
  374.  
  375. o Referencing IntuiMessage->IAddress as a Gadget pointer on non-Gadget IDCMP
  376. messages, or as a Window pointer (rather than looking at the proper field
  377. IntuiMessage->IDCMPWindow) may now cause Enforcer hits or crashes.  The
  378. IAddress field used to always contain a pointer of some type even for IDCMP
  379. events for which no IAddress value is documented.  Now, for some IDCMP
  380. events, IAddress may contain other data (a non-address, possibly an odd value
  381. which would crash a 68000 based system).
  382.  
  383. o Using Intuition flags in the wrong structure fields (for example, using
  384. ACTIVEWINDOW instead of ACTIVATE).  To alleviate this problem, 2.0 has
  385. introduced modern synonyms that are less confusing than the old ones.  For
  386. example, IDCMP_ACTIVEWINDOW and WFLG_ACTIVATE.  This particular example of
  387. confusion (there are several) was the nastiest, since IDCMP_ACTIVEWINDOW,
  388. when stuffed into NewWindow.Flags, corresponds numerically to
  389. WFLG_NW_EXTENDED, which informs Intuition that the NewWindow structure is
  390. immediately followed by a TagList, which isn't there!  Intuition does some
  391. validation on the tag-list pointer, in order to partially compensate.  To
  392. make your compiler use the new synonyms only, add this line to your code
  393. before Intuition include files: #define INTUI_V36_NAMES_ONLY.
  394.  
  395. o Do not place spaces into the StringInfo->Buffer of a LONGINT string gadget.
  396. Under 1.3, it turned out that worked, but under 2.0, the validation routine
  397. that checks for illegal keystrokes looks at the contents for illegal (i.e.
  398. non-numeric) characters, and if any are found assumes that the user typed an
  399. illegal keystroke.  The user's only options may be shift-delete or Amiga-X.
  400. Use the correct justification instead.
  401.  
  402. o If you specify NULL for a font in an IntuiText, don't assume you'll get
  403. Topaz 8.  Either explicitly supply the font you you need or be prepared to
  404. size accordingly.  Otherwise, your rendering will be wrong, and the user will
  405. have to reset his Preferences just to make your software work right.
  406.  
  407. o Window borders are now drawn in the screen's DetailPen and BlockPen rather
  408. than the Window's pens.  For best appearance, you should pass a SA_Pens array
  409. to OpenScreen().  This can be done in a backwards compatible manner with the
  410. ExtNewScreen structure and the NS_EXTENDED flag.
  411.  
  412. o The system now renders into the full width of window borders, although the
  413. widths themselves are unchanged.
  414.  
  415. o Window borders are filled upon activation and inactivation.
  416.  
  417. o Window border rendering has changed significantly for 2.0.  Note that the
  418. border dimensions are unchanged from 1.x (Look at
  419. window->BorderLeft/Top/Width/Height if you don't believe us!).  If your
  420. gadget intersects the border area, although it may have looked OK under 1.3,
  421. a visual conflict may occur under 2.0.  If Intuition notices a gadget which
  422. is substantially in the border but not declared as such, it treats it as
  423. though it were (this is called ``bordersniffing'').  Never rely on Intuition
  424. to sniff these out for you; always declare them explicitly (see the Gadget
  425. Activation flags GACT_RIGHTBORDER etc.).  See Intuition Gadgets and Window
  426. Borders in the Additional Information section at the end of this article.
  427.  
  428.  
  429. Preferences
  430.  
  431. o Some old struct Preferences fields are now ignored by SetPrefs (for example
  432. FontHeight).  SetPrefs also stops listening to the pointer fields as soon as
  433. a new-style pointer is passed to Intuition (new-style pointers can be taller
  434. or deeper).
  435.  
  436. o Preferences ViewX/YOffset only applies to the default mode.  You cannot use
  437. these fields to move the position of all modes.
  438.  
  439. o The Preferences LACEWB bit is not necessarily correct when Workbench is in
  440. a new display mode (akin to GetScreenData()).
  441.  
  442.  
  443. Workbench
  444.  
  445. o The Workbench GUI now has new screen sizes, screen top/left offsets,
  446. depths, modes, and fonts.
  447.  
  448. o Default Tool now searches paths.
  449.  
  450. o New Look (boxed) icons take more space.
  451.  
  452. o Do not use icons which have more 1bits set in PlanePick than planes in the
  453. ImageData (one IFF-to-Icon utility does this).  Such icons will appear
  454. trashed on deeper Workbenches.
  455.  
  456. o New Look colors have black and white swapped (as compared to 1.3).
  457.  
  458. o The Workbench screen may not be open at startup-sequence time until some
  459. output occurs to the initial Shell window.  This can break
  460. startup-sequence-started games that think they can steal WB's screen
  461. bitplanes.  Do not steal the WB screen's planes (For compatibility, booting
  462. off pre-2.0 disks forces the initial screen open.  This is not guaranteed to
  463. remain in the system).  Use startup code that can detach when RUN (such as
  464. cback.o) and use CloseWorkbench() to regain the screen's memory.
  465.  
  466. Under 1.3 the Workbench Screen and initial CLI opened before the first line in s:startup-sequence.  Some naughty programmers, in an attempt to recover memory, would search for the bitplane pointers and appropriate the memory for their own use.  This behavior is highly unsafe.
  467.  
  468. By default 2.0 opens the initial CLI on the first _output_ from the s:startup-sequence.  This allows screen modes and other parameters to be set before the user sees the screen.  However, this broke so many programs that we put in the ``silent-startup'' hack.  A disk installed with 1.3 install opens the screen as before.  A disk installed under 2.0 opens silently.
  469. Never steal the Workbench bitplanes.  You don't know where they are, how big they are, what format they may be in, or even if they are allocated.  Recovering the memory is a bit tricky.
  470.         Under 2.0:  Simply avoid any output from your s:startup-sequence.  If your program opens a screen it will be the first screen the user ever sees.  Note that if ENDCLI is ever hit, the screen will pop open.
  471.  
  472.         Under 1.3:  After ENDCLI, call the CloseWorkbench() function to close the screen.  This also works under 2.0.  Loop on CloseWorkbench() with a delay between loops.  Continue looping until CloseWorkbench() succeeds or too much time has passed.  Note that a new program called EndRun is available for starting non-returning programs from the startup-sequence.  EndRun will reduce memory fragmentation and will close Workbench if it is open.  EndRun.lzh will be available in Commodore's Amiga listings area on BIX.
  473.  
  474.  
  475. Layers
  476.  
  477. o Use NewLayerInfo() to create, not FattenLayerInfo(), ThinLayerInfo(),
  478. InitLayers().
  479.  
  480. o Simple-refresh preserves all of the pixels it can.  Sizing a SIMPLE_REFRESH
  481. window no longer clears the whole window.
  482.  
  483. o Speed of layer operations is different.  Don't depend on layer operations
  484. to finish before or after other asynchronous actions.
  485.  
  486.  
  487. Graphics
  488.  
  489. o Do not rely on the order of Copper list instructions.  For example, 2.0's
  490. MrgCop() builds different Copper lists to that of 1.3, by including new
  491. registers in the list (e.g. MOVE xxxx,DIWHIGH).  This changes the positions
  492. of  the  other  instructions.   We  know  of one game that 'assumes' the
  493. BPLxPTRs  would be at a certain offset in the Copper list, and that is now
  494. broken on machines running 2.0 with the new Denise chip.
  495.  
  496. o Graphics and layers functions which use the blitter generally return after
  497. STARTING the final blit.  If you are mixing graphics rendering calls and
  498. processor access of the same memory, you must WaitBlit() before touching (or
  499. deallocating) the source or destination memory with the processor.  For
  500. example, the Text() function was sped up for 2.0, causing some programs to
  501. trash partial lines of text.
  502.  
  503. o ColorMap structure is bigger.  Programs must use GetColorMap() to create
  504. one.
  505.  
  506. o Blitter rtns decide ascend/descend on 1st plane only.
  507.  
  508. o Changing the display mode of an existing screen or viewport while it is
  509. open is still not a supported operation.
  510.  
  511. o GfxBase DisplayFlags and row/cols may not match Workbench screen.
  512.  
  513. o Do not hardcode modulo values - use BitMap->BytesPerRow.
  514.  
  515. o If the graphics Autodocs say that you need a TmpRas of a certain size for
  516. some functions, then you must make that the minimum size.  In some cases,
  517. before 2.0, you may have gotten away with using a smaller TmpRas with some
  518. functions (for example Flood() ).  To be more robust, Graphics now checks the
  519. TmpRas size and will fail the function call if the TmpRas is too small.
  520.  
  521. o ECS chips under 2.0 use a different method of generating displays.  The
  522. display window registers now control DMA.
  523.  
  524. o LoadRGB4() used to poke colors into the active copperlist with no
  525. protection against deallocation of that copperlist while it was being poked.
  526. Under 2.0, semaphore protection of the copperlist was added to LoadRGB4().
  527. This semaphore protection makes it totally incorrect and extremely dangerous
  528. to call LoadRGB4() during an interrupt.  The general symptom of this problem
  529. is that a system deadlock can be caused by dragging one screen up and down
  530. while another is cycling.  Color cycling should be performed from within a
  531. task, not an interrupt.  Note that in general, the only functions which may
  532. be safely called from within an interrupt are the small list of Exec
  533. functions documented in the ``Exec: Interrupts'' chapter of ROM Kernel
  534. Manual: Libraries and Devices.
  535.  
  536.  
  537. Fonts
  538.  
  539. o Some font format changes (old format supported).
  540.  
  541. o Private format of .font files has changed (use FixFonts to create).
  542.  
  543. o Default fonts may be larger, proportional.
  544.  
  545. o Topaz is now sans-serif.
  546.  
  547. o Any size font will be created via scaling as long as TextAttr.Flags
  548. FPF_DESIGNED bit is not set.  If you were asking for an extreme size, like
  549. size 1 to get smallest available, or 999 to get largest available, you will
  550. get a big (or very very small) surprise now.
  551.  
  552. o Do not use -1 for TextAttr.Flags or Styles, nor as the flags for AvailFonts
  553. (one high bit now causes AvailFonts to return different structures).  Only
  554. set what you know you want.  A kludge has been added to the OS to protect
  555. applications which currently pass -1 for AvailFonts flags.
  556.  
  557.  
  558. CLI / Shell
  559.  
  560. o Many more commands are now built-in (no longer in C:).  This can break
  561. installation scripts that copy C:commandname, and programs that try to Lock()
  562. or Open() C:commandname to check for the command's existence.
  563.  
  564. o The limit of 20 CLI processes is gone and the DOSBase CLI table has changed
  565. to accomodate this.  Under V36 and higher, you should use new 2.0 functions
  566. rather than accessing the CLI table directly.
  567.  
  568. o Shell windows now have Close Gadgets.  The EOF character is passed for the
  569. Close Gadget of a Shell.  This is -1L with CON: getchar(), and the Close
  570. Gadget raw event ESC seq with RAW:.
  571.  
  572. o Shells now use the simple-refresh character-mapped console (see Console
  573. notes).
  574.  
  575.  
  576. Console
  577.  
  578. o By default, CON: now opens SIMPLE_REFRESH windows using the V36/V37 console
  579. character mapped mode.  Because of some differences between character mapped
  580. consoles, and SMART_REFRESH non-mapped consoles, this may cause
  581. incompatibilities with some applications.  For example, the Amiga private
  582. sequences to set left/top offset, and set line/page length behave differently
  583. in character mapped console windows.  The only known work-around is to
  584. recompile asking for a CON: (or RAW:) window using the SMART flag.
  585.  
  586. o Simple refresh/character mapped console windows now support the ability to
  587. highlight, and copy text with the mouse.  This feature, as well as pasting
  588. text should be transparent to programs which use CON: for console input, and
  589. output.  Pasted text will appear in your input stream as if the user had
  590. typed it.
  591.  
  592. o While CONCLIP (see s:startup-sequence) is running, programs may receive
  593. ``<CSI>0 v'' in their input stream indicating the user wants to paste text
  594. from the clipboard.  This shouldn't cause any problems for programs which
  595. parse correctly (however we know that it does; the most common problems are
  596. outputting the sequence, or confusing it with another sequence like that for
  597. FKEY 1 which is ``<CSI>0~'').
  598.  
  599. o The console.device now renders a ghosted cursor in inactive console windows
  600. (both SMART_REFRESH, and SIMPLE_REFRESH with character maps).  Therefore,
  601. rendering over the console's cursor with graphics.library calls can trash the
  602. cursor; if you must do this, first turn off the cursor.
  603.  
  604. o Some degree of unofficial support has been put in for programs which use
  605. SMART_REFRESH console windows, and use graphics.library calls mixed with
  606. console.device sequences to scroll, draw text, clear, etc.  This is not
  607. supported in SIMPLE_REFRESH windows with character maps, and is strongly
  608. discouraged in all cases.
  609.  
  610. o Closing an Intuition window before closing the attached console.device
  611. worked in the past; it will now crash or hang the machine.
  612.  
  613. o Under 1.2-1.3, vacated portions of a console window (e.g., areas vacated
  614. because of a clear, or a scroll) were filled in with the character cell
  615. color.  As of V36 this is no longer true; vacated areas are filled in with
  616. the global background color which can be set using the SGR sequence
  617. ``<ESC>[>##m'' where ## is a value between 0-7.  In order to set the
  618. background color under V36/V37, send the SGR to set background color, and a
  619. FormFeed to clear the screen.
  620.  
  621. o Note that SIMPLE_REFRESH character mapped consoles are immediately redrawn
  622. with the global background color when changed--this is not possible with
  623. SMART_REFRESH windows.
  624.  
  625.  
  626. Additional Information
  627.  
  628.  
  629. Task Switching
  630.  
  631. The 1.3 Kickstart contained two task switching bugs.  After an interrupt, a
  632. task could lose the CPU to another equal priority task, even if the first
  633. task's time was not up.  The second bug allowed a task who's time was up to
  634. hold on to the CPU either forever, or until a higher priority task was
  635. scheduled.  Two busy-waiting tasks at high priority would never share the
  636. CPU.  Because the input.device runs at priority 20, usually the effect of
  637. these bugs was masked out for low priority tasks.  Because of the bugs, the
  638. ExecBase->Quantum field had little effect.
  639.  
  640. For 2.0, a task runs until either its Quantum is up, or a higher priority
  641. task preempts it.  When the Quantum time is up, the task will now lose the
  642. CPU.  The Quantum was set to 16/60 second for 1.3, and 4/60 second for 2.0.
  643.  
  644. In general, the 2.0 change makes the system more efficient by eliminating
  645. unnecessary task switches on interrupt-busy systems (for example, during
  646. serial input).  However, the change has caused problems for some programs
  647. that use two tasks of equal priority, one busy-waiting and one Wait()ing on
  648. events such as serial input.  Previously, each incoming serial character
  649. interrupt would cause task context switch allowing the event-handling task to
  650. run immediately.  Under 2.0 the two tasks share the processor fairly.
  651.  
  652.  
  653. Intuition Gadgets and Window Borders
  654.  
  655. If 2.0 Intuition finds a gadget whose hit area (gadget Left/Top/
  656. Width/Height) is substantially inside the border, it will be treated as
  657. though it was declared in the border.  This is called ``bordersniffing''.
  658. Gadgets declared as being in the border or detected by Intuition as being in
  659. the border are refreshed each time after the border is refreshed, and thus
  660. aren't clobbered.
  661.  
  662. Noteworthy special cases:
  663.  
  664. 1) A gadget that has several pixels not in the border is not bordersniffed.
  665. An example would be an 18-pixel high gadget in the bottom border of a
  666. SIZEBBOTTOM window.  About half the gadget will be clobbered by the border
  667. rendering.
  668.  
  669. 2) A gadget that is not substantially in the border but has imagery that
  670. extends into the border cannot be sniffed out by Intuition.
  671.  
  672. 3) A gadget that is substantially in the border but has imagery that extends
  673. into the main part of the window will be sniffed out as a border gadget, and
  674. this could change the refreshing results.  A common trick to put imagery in a
  675. window is to put a 1x1 or 0x0 dummy gadget at window location (0,0) and
  676. attach the window imagery to it.  To support this, Intuition will never
  677. bordersniff gadgets of size |x| or smaller.
  678.  
  679. All these cases can be fixed by setting the appropriate GACT_xxxBORDER gadget
  680. Activation flag.
  681.  
  682. 4) In rare cases, buttons rendered with Border structures and JAM1 text may
  683. appear invisible under 2.0.  We apologize, but there is nothing that can be
  684. done on our end, even if the application technically did nothing wrong.
  685.  
  686.  
  687. Intuition Fonts
  688.  
  689. The following table shows where the Intuition gets its fonts from:
  690.  
  691.  
  692.    What you tell OpenScreen        Screen's Font        Windows' RPort's Font
  693.  
  694. A.  NewScreen.Font = myfont     myfont                          myfont
  695. B.  NewScreen.Font = NULL       GfxBase->DefaultFont    GfxBase->DefaultFont
  696. C.  {SA_Font, myfont}           myfont                          myfont
  697. D.  {SA_SysFont, 0}             GfxBase->DefaultFont    GfxBase->DefaultFont
  698. E.  {SA_SysFont, 1}             Font Prefs Screen text  GfxBase->DefaultFont
  699.  
  700.  
  701. Notes:
  702.  
  703.   A and B are the options that existed in releases prior to V36.
  704.  
  705.   C and D are new V36 tags that are equivalent to A and B respectively.
  706.  
  707.   E is a NEW option for V36.  The Workbench screen uses this option.
  708.  
  709.   GfxBase->DefaultFont will always be monospace.  This is the
  710.   ``System Default Text'' from Font Preferences.
  711.  
  712.   The ``Screen Text'' choice from Font Preferences can be monospace or
  713.   proportional.
  714.  
  715.   'myfont' can be any font of the programmer's choosing, including a
  716.   proportional one.  This is true under all releases of the OS.
  717.  
  718.  
  719.  
  720. The menu bar, window titles, menu-items, and the contents of a string gadget
  721. use the screen's font.  The font used for menu items can be overridden in the
  722. item's IntuiText structure.  Under V36 and higher, the font used in a string
  723. gadget can be overridden through the StringExtend structure.  The font of the
  724. menu bar and window titles cannot be overridden.  Because the 2.0 Workbench
  725. screen uses option E to specify its Screen font from the user's Screen font
  726. Preferences, applications which open windows on the Workbench screen may get
  727. very large or proportional fonts in their menu bars, window titles,
  728. menu-items and string gadgets.
  729.  
  730. To predict your window's titlebar height before you call OpenWindow():
  731.  
  732.     topborder = screen->WBorTop + screen->Font->ta_YSize + 1
  733.  
  734. The screen's font may not legally be changed after a screen is opened.
  735.  
  736. Be sure the screen cannot go away on you.  This is true if:
  737.  
  738.         1) You opened the screen yourself.
  739.         2) You currently have a window open on the screen.
  740.         3) You currently hold a lock on this screen (see LockPubScreen() ).
  741.  
  742. IntuiText rendered into a window (either through PrintIText() or as a
  743. gadget's GadgetText) defaults to the Window RastPort font, but can be
  744. overridden using its ITextFont field.  Text rendered with the Text()
  745. graphics.library call appears in the Window RastPort font.
  746.  
  747. The Window's RPort's font shown above is the initial font that Intuition sets
  748. for you in your window's RastPort.  It is legal to change that subsequently
  749. with SetFont().
  750.